package com.hxx.day4;

import java.time.LocalDateTime;

public class TestDemo {
    public static void main(String[] args) {
        AInter a = new BProxy();//A();
        a.show();
    }
}

//代理的标准
interface AInter {
     void show();
}
//实现接口
class A implements AInter{
    public void show(){
        System.out.println("这是一个方法");
    }
}
//通过代理方式实现了开闭原则
class BProxy  implements AInter{
    public void show(){
        System.out.println(LocalDateTime.now());
        new A().show();
    }
}
